﻿using System;
using System.Collections.Generic;
//using System.Linq;
using System.Text;


namespace WellLogShower
{
    public class LogData
    {
        private String name;
        private String unit;
        private List<double> data;

        public LogData()
        {
            name = "曲线名";
            unit = "单位";
            data = new List<double>();
            //data.Add(25);

            //Random rand = new Random();
            //for (int i = 0; i < 500; i++)
            //{
            //    double val = data.Last();
            //    data.Add(rand.NextDouble() * 10 - 5 + val);
            //}
        }

        public String Name
        {
            get { return name; }
            set { name = value; }
        }

        public String Unit
        {
            get { return unit; }
            set { unit = value; }
        }

        public List<double> Data
        {
            get { return data; }
            set { data = value; }
        }

        public static double Max(List<double> list)
        {
            double r = 0;
            foreach (double d in list)
            {
                r = r > d ? r : d;
            }
            return r;
        }

        public static double Min(List<double> list)
        {
            double r = 0;
            foreach (double d in list)
            {
                r = r < d ? r : d;
            }
            return r;
        }
    }
}
